package com.livestocksolutions.ui;

import android.view.View;
import android.view.ViewGroup;

import com.livestocksolutions.R;
import com.livestocksolutions.intent.BaseActivity;

/* -- Version History --
 *  1.0 : 09 September 2012 - Initial version.
 */

/**
 * A base class to create the layout for a Group Object
 * @author Adam Parr
 * @version 1.0
 * 
 * @.modified 09 September 2012
 */
public class ViewGroupArrayAdapter extends ViewGroupMobArrayAdapter {
	/**
	 * Constructor
	 * @param context The current context.
	 * @param values The Group data to represent in the ListView.
	 */
	public ViewGroupArrayAdapter(BaseActivity context, String[] values) {
		super(context, new String[][]{values});
	}
	
	@Override
	public View getView(final int position, View convertView, ViewGroup parent) {
		if(textViewResourceId==0){
			setView(R.layout.item_group_view);
		}
		return super.getView(position, convertView, parent);
	}
	
	/**
	 * Display the View that will allow the modification of some fields.<br>
	 * This should be used when choosing to modify the Group.
	 */
	public void setModifyGroup(){
		setView(R.layout.item_group_modify);
	}
	
	/**
	 * Display the View that will only display the Group details.
	 */
	public void setViewGroup(){
		setView(R.layout.item_group_view);
	}
}
